package cn.zjh.basic.service.impl;

import cn.zjh.basic.service.IBaiduAiService;
import cn.zjh.basic.util.BaiduAuditUtils;

public class BaiduAiServiceImpl implements IBaiduAiService {

    //文本处理
    @Override
    public Boolean baiduAiText(String text) {

        return BaiduAuditUtils.TextCensor(text);

    }

    //资源图片处理审核
    @Override
    public Boolean baiduAiImg(String resources) {

        Boolean result = true;

        //如果图片为空就返回让result为true，
        if (resources != null) {

            String[] arr = resources.split(",");
            for (String s : arr) {
                //判断图片审核是否失败，只要有一张失败就都失败
                if (!BaiduAuditUtils.ImgCensor("http://123.207.27.208" + s)) {
                    result = false;
                    break;
                }
            }
        }
        return result;
    }
}
